<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('资产添加')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-property-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">仪器编号：</label>
                <div class="col-sm-8">
                    <input name="machineNumber" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">仪器型号：</label>
                <div class="col-sm-8">
                    <input name="modelNumber" class="form-control" type="text"  required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">资产名称：</label>
                <div class="col-sm-8">
                    <input name="propertyName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">实验室名称：</label>
                <div class="col-sm-8">
                <select name="labId" class="form-control m-b" required>
                    <option th:each="lab : ${labName}" th:text="${lab.labName}" th:value="${lab.id}"></option>
                </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">资产类别：</label>
                <div class="col-sm-8">
                    <select name="propertyType" class="form-control m-b" required>
                        <option th:each="dict : ${dictData}" th:text="${dict.dictLabel}" th:value="${dict.dictCode}"></option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> <!--代码生成请选择字典属性--></span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">购置日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="buyTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "labproperty"
        $("#form-property-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-property-add').serialize());
            }
        }

        $("input[name='buyTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>